package com.demo.enums;

public enum ResponseStatus implements BaseEnum<ResponseStatus>{

    SUCCESS(1000, "Success"), 
    NO_DATA(1001, "No Data"),
    RESOURCE_NOT_FOUND(4000, "Resource Not Found"), 
    UNAUTHORIATION(4001, "UnLogin"),
    TOKEN_EXPIRED(4002, "Token Expired"), 
    REFRESH_TOKEN_EXPIRED(4003, "RereshToken Expired"),
    FORBIDDEN(4004, "No Permit"),
    ERROR(5000, "Service Error"),
    SQL_ERROR(5001, "SQL Error"), 
    VALID_ERROR(5002, "Parameter Error"), // 业务错误 例 : 参数不匹配或参数验证不正确
    PARAM_ERROR(5003, "Parse Parameter Error"),
    LOGIN_ERROR(5004, "Username/Password Error or username is disabled"), 
    VALIDCODE_ERROR(5005, "ValidCode Error"),
    BUSINESS_ERROR(5006, "Business Error"), // 业务错误 例 : 参数不匹配或参数验证不正确
    UNKONWN(-1, "Unknown Erro");
    
    private String message;
    
    private int code;

    ResponseStatus(int code, String message) {
        this.message = message;
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public int getCode() {
        return code;
    }

    public static ResponseStatus parse(int code) {
         return null;
    }

}
